<template>
    <div class="main">
    <span>用户注册列表</span>
    <el-table :data="userList" style="width: 100%">
        <el-table-column prop="name" label="姓名" width="180" />
        <el-table-column prop="sex" label="性别" width="180" />
        <el-table-column prop="addr" label="地区" />
        <el-table-column prop="hobby" label="爱好" />
    </el-table>
</div>
</template>

<script>
/* eslint-disable */
import axios from "axios"

export default {
    name: 'user',
    data() {
        return {
            userList: []

        }
    },
    mounted() {
        this.getUser();
    },
    methods: {
        getUser(){
            axios.get("http://localhost:8001/vue/user/getUser").then((res) => {
               this.userList=res.data;
            });
        }

    }
}

</script>
<style>

.main {
  text-align: center;
  border: 1px solid;
  border-radius: 5px;
  padding: 20px;
  width: 800px;
  margin: 100px auto;
}
</style>